package com.orderVideo.dto;

import com.orderVideo.entity.User;
import lombok.Data;
import lombok.EqualsAndHashCode;

@EqualsAndHashCode(callSuper = true)
@Data
public class UserInfoDTO extends User {
    private String avatarBase64;
    
    public static UserInfoDTO fromUser(User user) {
        UserInfoDTO dto = new UserInfoDTO();
        // 复制User的所有属性
        dto.setUserId(user.getUserId());
        dto.setUsername(user.getUsername());
        dto.setPassword(user.getPassword());
        dto.setNickName(user.getNickName());
        dto.setUserImg(user.getUserImg());
        dto.setUserType(user.getUserType());
        dto.setUserMoney(user.getUserMoney());
        dto.setToken(user.getToken());
        return dto;
    }
} 